import http from './http'
export const UserApi = {
    list: data => http({
        method: "post",
        url: "/user/list",
        data
    }),
    add: data => http({
        method: "post",
        url: "/user/add",
        data
    }),
    update: data => http({
        method: "post",
        url: "/user/change_pwd",
        data
    }),
    remove: user_name => http({
        method: "post",
        url: `/user/remove/${user_name}`
    }),
    configUserRole: data => http({
        method: "post",
        url: "/user/config_role",
        data
    }),
    validName: user_name => http({
        method: "post",
        url: "/user/valid_name",
        data: {
            user_name
        }
    }),
    configRole: data => http({
        method: "post",
        url: "/user/config_role",
        data
    })
}
export const RoleFuncApi = {
    getRoleFunctions: role_id => http({
        method: "get",
        url: `/role_function/list/${role_id}`
    }),
    configRoleFunc: data => http({
        method: "post",
        url: `/role_function/config`,
        data
    })
}
export const ClassApi = {
    getClass: data => http({
        method: "post",
        url: "/class/list",
        data
    })
}